package c.h.a.x.t;

import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.l;
import androidx.recyclerview.widget.RecyclerView.w;
import androidx.recyclerview.widget.RecyclerView.z;
import c.h.a.m0.h;
import com.liuzh.deviceinfo.DeviceInfoApp;
import java.util.List;

/* compiled from: BroadcastReceiverData */
public class e implements l {
    public List<b> a;
    public Fragment b;

    /* compiled from: BroadcastReceiverData */
    public static class b {
        public final ActivityInfo a;
        public boolean b = false;

        public b(ActivityInfo activityInfo) {
            this.a = activityInfo;
        }
    }

    /* compiled from: BroadcastReceiverData */
    public static class a extends Fragment {
        public e W;
        public RecyclerView X;
        public Context Y;
        public b Z;

        /* compiled from: BroadcastReceiverData */
        public class a extends l {
            public int a = h.t(8.0f, DeviceInfoApp.c.getResources().getDisplayMetrics());

            public void f(Rect rect, View view, RecyclerView recyclerView, w wVar) {
                int J = recyclerView.J(view);
                int i = this.a;
                rect.left = i;
                rect.right = i;
                if (J == 0) {
                    rect.top = i;
                } else if (J == a.this.Z.a() - 1) {
                    rect.bottom = this.a;
                }
            }
        }

        /* compiled from: BroadcastReceiverData */
        public class b extends androidx.recyclerview.widget.RecyclerView.e<a> {
            public LayoutInflater c;

            /* compiled from: BroadcastReceiverData */
            public class a extends z implements OnClickListener, OnLongClickListener {
                public ImageView A;
                public TextView t;
                public TextView u;
                public View v;
                public TextView w;
                public View x;
                public View y;
                public View z;

                public a(View view) {
                    super(view);
                    this.y = view.findViewById(2131296505);
                    this.z = view.findViewById(2131296606);
                    this.A = (ImageView) view.findViewById(2131296375);
                    this.z.setOnClickListener(this);
                    this.z.setOnLongClickListener(this);
                    this.t = (TextView) view.findViewById(2131297266);
                    TextView textView = (TextView) view.findViewById(2131296792);
                    this.u = textView;
                    View view2 = (View) textView.getParent();
                    this.v = view2;
                    view2.setOnClickListener(this);
                    this.v.setOnLongClickListener(this);
                    textView = (TextView) view.findViewById(2131296549);
                    this.w = textView;
                    view2 = (View) textView.getParent();
                    this.x = view2;
                    view2.setOnClickListener(this);
                }

                public void onClick(View view) {
                    b bVar = (b) a.this.W.a.get(e());
                    if (view == this.z) {
                        this.A.animate().rotation(bVar.b ? 0.0f : 180.0f).start();
                        this.y.setVisibility(bVar.b ? 8 : 0);
                        bVar.b ^= 1;
                        return;
                    }
                    String str = ": ";
                    StringBuilder stringBuilder;
                    if (view == this.v) {
                        stringBuilder = new StringBuilder();
                        c.b.a.a.a.n(a.this.Y, 2131690218, stringBuilder, str);
                        stringBuilder.append(this.u.getText());
                        w(stringBuilder.toString(), 2131690219);
                    } else if (view == this.x) {
                        stringBuilder = new StringBuilder();
                        c.b.a.a.a.n(a.this.Y, 2131690216, stringBuilder, str);
                        stringBuilder.append(this.w.getText());
                        w(stringBuilder.toString(), 2131690217);
                    }
                }

                public boolean onLongClick(View view) {
                    String str = "";
                    if (view == this.v) {
                        c.b.a.a.a.q(this.u, a.this.Y, str);
                    } else if (view != this.z) {
                        return false;
                    } else {
                        c.b.a.a.a.q(this.t, a.this.Y, str);
                    }
                    return true;
                }

                public void w(String str, int i) {
                    b.b.c.f.a aVar = new b.b.c.f.a(a.this.Y);
                    androidx.appcompat.app.AlertController.b bVar = aVar.a;
                    bVar.d = str;
                    bVar.f = bVar.a.getText(i);
                    aVar.b(17039370, null);
                    aVar.g();
                }
            }

            public b() {
                this.c = LayoutInflater.from(a.this.Y);
            }

            public int a() {
                e eVar = a.this.W;
                if (eVar == null) {
                    return 0;
                }
                List list = eVar.a;
                if (list == null) {
                    return 0;
                }
                return list.size();
            }

            public void f(z zVar, int i) {
                a aVar = (a) zVar;
                b bVar = (b) a.this.W.a.get(i);
                ActivityInfo activityInfo = bVar.a;
                aVar.u.setText(h.e(activityInfo.permission));
                aVar.w.setText(h.d(activityInfo.exported));
                aVar.t.setText(activityInfo.name);
                aVar.y.setVisibility(bVar.b ? 0 : 8);
            }

            public z g(ViewGroup viewGroup, int i) {
                return new a(this.c.inflate(2131492977, viewGroup, false));
            }
        }

        public void D(Context context) {
            super.D(context);
            this.Y = context;
        }

        public View G(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
            if (this.X == null) {
                this.X = (RecyclerView) layoutInflater.inflate(2131492911, viewGroup, false);
                b bVar = new b();
                this.Z = bVar;
                this.X.setAdapter(bVar);
                this.X.g(new a());
            }
            return this.X;
        }
    }

    public String a() {
        return DeviceInfoApp.c.getString(2131689642);
    }

    public Fragment b() {
        if (this.b == null) {
            this.b = new a();
        }
        return this.b;
    }
}
